package ch.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class result {
    private int code;
    private String msg;
    private Object data;
    public static result success(Object data){
        return new result(200,"成功",data);
    }
    public static result success(String msg,Object data){
        return new result(200,msg,data);
    }
    public static result success(String msg){
        return new result(200,msg,null);
    }
    public static result err(){
        return new result(500,"后端有问题",null);
    }
    public static result err(String msg){
        return new result(500,msg,null);
    }
}
